/*
 *  Copyright 2022 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/*  Copyright 2022 Collate
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

import { TeamType } from '../generated/entity/teams/team';

export const MOCK_CURRENT_TEAM = {
  childrenCount: 22,
  defaultRoles: [
    {
      deleted: false,
      description:
        'Users with Data Consumer role use different data assets for their day to day work.',
      displayName: 'Data Consumer',
      fullyQualifiedName: 'DataConsumer',
      href: 'http://sandbox-beta.open-metadata.org/api/v1/roles/1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
      id: '1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
      name: 'DataConsumer',
      type: 'role',
    },
  ],
  deleted: false,
  description:
    'Organization under which all the other team hierarchy is created',
  displayName: 'Organization',
  fullyQualifiedName: 'Organization',
  href: 'http://sandbox-beta.open-metadata.org/api/v1/teams/f9578f16-363a-4788-80fb-d05816c9e169',
  id: 'f9578f16-363a-4788-80fb-d05816c9e169',
  inheritedRoles: [],
  isJoinable: false,
  name: 'Organization',
  owns: [],
  parents: [],
  policies: [
    {
      deleted: false,
      description: 'Policy for all the users of an organization.',
      displayName: 'Organization Policy',
      fullyQualifiedName: 'OrganizationPolicy',
      href: 'http://sandbox-beta.open-metadata.org/api/v1/policies/09f4480c-ef57-4239-b2aa-c87053ad4f46',
      id: '09f4480c-ef57-4239-b2aa-c87053ad4f46',
      name: 'OrganizationPolicy',
      type: 'policy',
    },
  ],
  teamType: undefined,
  updatedAt: 1669719624263,
  updatedBy: 'ag939431',
  users: [],
  version: 2.4,
};

export const MOCK_TABLE_DATA = [
  {
    children: [
      {
        children: undefined,
        childrenCount: 0,
        defaultRoles: [],
        deleted: false,
        fullyQualifiedName: 'Applications',
        href: 'http://localhost:8585/api/v1/teams/eb4b1b74-d30e-4bfa-8409-dac15db3cc32',
        id: 'eb4b1b74-d30e-4bfa-8409-dac15db3cc32',
        inheritedRoles: [],
        isJoinable: true,
        key: 'Applications',
        name: 'Applications',
        owns: [],
        teamType: 'Group',
        updatedAt: 1670390160760,
        updatedBy: 'admin',
        userCount: 12,
        version: 0.1,
        type: 'BusinessUnit',
      },
      {
        children: undefined,
        childrenCount: 3,
        defaultRoles: [],
        deleted: false,
        fullyQualifiedName: 'Infrastructure',
        href: 'http://localhost:8585/api/v1/teams/c8cc8922-8917-4d33-94e3-d9d257dd8830',
        id: 'c8cc8922-8917-4d33-94e3-d9d257dd8830',
        inheritedRoles: [],
        isJoinable: true,
        key: 'Infrastructure',
        name: 'Infrastructure',
        owns: [],
        teamType: 'BusinessUnit',
        type: 'BusinessUnit',
        updatedAt: 1670390159742,
        updatedBy: 'admin',
        userCount: 20,
        version: 0.1,
      },
    ],
    childrenCount: 4,
    defaultRoles: [],
    deleted: false,
    fullyQualifiedName: 'Engineering',
    href: 'http://sandbox-beta.open-metadata.org/api/v1/teams/49d060a2-ad14-48a7-840a-836cd99aaffb',
    id: '49d060a2-ad14-48a7-840a-836cd99aaffb',
    inheritedRoles: [
      {
        deleted: false,
        description:
          'Users with Data Consumer role use different data assets for their day to day work.',
        displayName: 'Data Consumer',
        fullyQualifiedName: 'DataConsumer',
        href: 'http://sandbox-beta.open-metadata.org/api/v1/roles/1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        id: '1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        name: 'DataConsumer',
        type: 'role',
      },
    ],
    isJoinable: true,
    key: 'Engineering',
    name: 'Engineering',
    owns: [],
    teamType: undefined,
    updatedAt: 1670312015218,
    updatedBy: 'ingestion-bot',
    userCount: 50,
  },
  {
    children: [],
    childrenCount: 3,
    defaultRoles: [],
    deleted: false,
    fullyQualifiedName: 'Finance',
    href: 'http://sandbox-beta.open-metadata.org/api/v1/teams/b201a5b2-b0e8-461d-9fa1-cd5212d09eee',
    id: 'b201a5b2-b0e8-461d-9fa1-cd5212d09eee',
    inheritedRoles: [
      {
        deleted: false,
        description:
          'Users with Data Consumer role use different data assets for their day to day work.',
        displayName: 'Data Consumer',
        fullyQualifiedName: 'DataConsumer',
        href: 'http://sandbox-beta.open-metadata.org/api/v1/roles/1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        id: '1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        name: 'DataConsumer',
        type: 'role',
      },
    ],
    isJoinable: true,
    key: 'Finance',
    name: 'Finance',
    owns: [],
    teamType: undefined,
    updatedAt: 1670312016093,
    updatedBy: 'ingestion-bot',
    userCount: 2,
  },
  {
    children: [],
    childrenCount: 2,
    defaultRoles: [],
    deleted: false,
    fullyQualifiedName: 'Legal',
    href: 'http://sandbox-beta.open-metadata.org/api/v1/teams/e64afbd0-aab5-4aed-952d-c5a5b8ba06bb',
    id: 'e64afbd0-aab5-4aed-952d-c5a5b8ba06bb',
    inheritedRoles: [
      {
        deleted: false,
        description:
          'Users with Data Consumer role use different data assets for their day to day work.',
        displayName: 'Legal',
        fullyQualifiedName: 'Legal',
        href: 'http://sandbox-beta.open-metadata.org/api/v1/roles/1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        id: '1497b0cf-cb5f-42c2-8e13-3ab68b90bfa0',
        name: 'Legal',
        type: 'role',
      },
    ],
    isJoinable: true,
    key: 'Marketing',
    name: 'Marketing',
    owns: [],
    teamType: undefined,
    updatedAt: 1670312016516,
    updatedBy: 'ingestion-bot',
    userCount: 3,
  },
];

export const MOCK_MARKETING_TEAM = {
  id: 'afa05b3f-bee4-4ead-8457-d82f0040faf8',
  teamType: 'Group',
  name: 'Marketing',
  fullyQualifiedName: 'Marketing',
  version: 0.1,
  updatedAt: 1686117247164,
  updatedBy: 'admin',
  href: 'test',
  parents: [
    {
      id: '7d82d6ca-9768-4a51-b4be-36c0f2add94c',
      type: 'team',
      name: 'Finance',
      fullyQualifiedName: 'Finance',
      deleted: false,
      href: 'test',
    },
  ],
  users: [
    {
      id: '17c88b6f-8f21-40d3-afeb-30f5bdc2a537',
      type: 'user',
      name: 'aaron_warren5',
      fullyQualifiedName: 'aaron_warren5',
      displayName: 'Aaron Warren',
      deleted: false,
      href: 'test',
      email: 'aaron_warren5@gmail.com',
    },
  ],
  childrenCount: 0,
  owns: [],
  isJoinable: true,
  deleted: false,
  defaultRoles: [],
  inheritedRoles: [
    {
      id: '829d9442-5e38-401b-8f32-8970c1290360',
      type: 'role',
      name: 'DataConsumer',
      fullyQualifiedName: 'DataConsumer',
      description:
        'Users with Data Consumer role use different data assets for their day to day work.',
      displayName: 'Data Consumer',
      deleted: false,
      href: 'test',
    },
  ],
  policies: [],
};

export const MOCK_CSV_TEAM_DATA = {
  rowData: [
    [
      'status',
      'details',
      'name*',
      'displayName',
      'description',
      'teamType*',
      'parents*',
      'Owner',
      'isJoinable',
      'defaultRoles',
      'policies',
    ],
    [
      'success',
      'Entity updated',
      'Applications',
      '',
      '',
      'Group',
      'Engineering',
      '',
      'true',
      '',
      '',
    ],
    [
      'success',
      'Entity updated',
      'Infrastructure',
      '',
      '',
      'BusinessUnit',
      'Engineering',
      '',
      'true',
      '',
      '',
    ],
  ],
  parseData: [
    {
      status: 'success',
      details: 'Entity updated',
      'name*': 'Applications',
      displayName: '',
      description: '',
      'teamType*': 'Group',
      'parents*': 'Engineering',
      Owner: '',
      isJoinable: 'true',
      defaultRoles: '',
      policies: '',
    },
    {
      status: 'success',
      details: 'Entity updated',
      'name*': 'Infrastructure',
      displayName: '',
      description: '',
      'teamType*': 'BusinessUnit',
      'parents*': 'Engineering',
      Owner: '',
      isJoinable: 'true',
      defaultRoles: '',
      policies: '',
    },
  ],
};

export const MOCK_CHILD_TEAMS = [
  {
    id: '7df98e19-d2f5-4397-b132-553543b8a33c',
    teamType: TeamType.BusinessUnit,
    name: 'Engineering',
    fullyQualifiedName: 'Engineering',
    version: 0.1,
    updatedAt: 1714123568397,
    updatedBy: 'admin',
    href: 'http://localhost:8585/api/v1/teams/7df98e19-d2f5-4397-b132-553543b8a33c',
    parents: [
      {
        id: 'a0fb0583-b9b0-4fc4-8435-01acac401bca',
        type: 'team',
        name: 'Organization',
        fullyQualifiedName: 'Organization',
        description:
          'Organization under which all the other team hierarchy is created',
        displayName: 'Organization',
        deleted: false,
        href: 'http://localhost:8585/api/v1/teams/a0fb0583-b9b0-4fc4-8435-01acac401bca',
      },
    ],
    childrenCount: 4,
    userCount: 50,
    owns: [],
    isJoinable: true,
    deleted: false,
    key: 'Engineering',
    children: [],
  },
  {
    id: 'f79a6126-0fc3-4a65-9e22-3e64965833be',
    teamType: TeamType.Department,
    name: 'Finance',
    fullyQualifiedName: 'Finance',
    version: 0.1,
    updatedAt: 1714123568722,
    updatedBy: 'admin',
    href: 'http://localhost:8585/api/v1/teams/f79a6126-0fc3-4a65-9e22-3e64965833be',
    parents: [
      {
        id: 'a0fb0583-b9b0-4fc4-8435-01acac401bca',
        type: 'team',
        name: 'Organization',
        fullyQualifiedName: 'Organization',
        description:
          'Organization under which all the other team hierarchy is created',
        displayName: 'Organization',
        deleted: false,
        href: 'http://localhost:8585/api/v1/teams/a0fb0583-b9b0-4fc4-8435-01acac401bca',
      },
    ],
    childrenCount: 3,
    userCount: 33,
    owns: [],
    isJoinable: true,
    deleted: false,
    key: 'Finance',
    children: [],
  },
  {
    id: '7ff84954-632f-4c0c-a35d-c588e32851cf',
    teamType: TeamType.Group,
    name: 'Grey',
    fullyQualifiedName: 'Grey',
    displayName: 'drey',
    description: '',
    version: 0.3,
    updatedAt: 1714130871577,
    updatedBy: 'admin',
    href: 'http://localhost:8585/api/v1/teams/7ff84954-632f-4c0c-a35d-c588e32851cf',
    parents: [
      {
        id: 'a0fb0583-b9b0-4fc4-8435-01acac401bca',
        type: 'team',
        name: 'Organization',
        fullyQualifiedName: 'Organization',
        description:
          'Organization under which all the other team hierarchy is created',
        displayName: 'Organization',
        deleted: false,
        href: 'http://localhost:8585/api/v1/teams/a0fb0583-b9b0-4fc4-8435-01acac401bca',
      },
    ],
    childrenCount: 0,
    userCount: 0,
    owns: [],
    isJoinable: true,
    changeDescription: {
      fieldsAdded: [],
      fieldsUpdated: [
        {
          name: 'deleted',
          oldValue: false,
          newValue: true,
        },
      ],
      fieldsDeleted: [],
      previousVersion: 0.2,
    },
    deleted: true,
    key: 'Grey',
  },
  {
    id: '8e2e92ee-4fee-4c2d-894d-38c144f49894',
    teamType: TeamType.Division,
    displayName: 'Aim_Legal',
    name: 'Legal',
    fullyQualifiedName: 'Legal',
    version: 0.1,
    updatedAt: 1714123568886,
    updatedBy: 'admin',
    href: 'http://localhost:8585/api/v1/teams/8e2e92ee-4fee-4c2d-894d-38c144f49894',
    parents: [
      {
        id: 'a0fb0583-b9b0-4fc4-8435-01acac401bca',
        type: 'team',
        name: 'Organization',
        fullyQualifiedName: 'Organization',
        description:
          'Organization under which all the other team hierarchy is created',
        displayName: 'Organization',
        deleted: false,
        href: 'http://localhost:8585/api/v1/teams/a0fb0583-b9b0-4fc4-8435-01acac401bca',
      },
    ],
    childrenCount: 2,
    userCount: 17,
    owns: [],
    isJoinable: true,
    deleted: false,
    key: 'Legal',
    children: [],
  },
];
